#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-12-22 17:23:39
# @Author  : yangxinpeng (yxpeng25877@gmail.com)
# @Link    : ${link}
# @Version : $Id$

import os
# 导入socket库:
import socket

# 创建一个socket:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# 建立连接:
s.connect(('www.sina.com.cn', 80))
s.send(b'GET / HTTP/1.1\r\nHost: www.sina.com.cn\r\nConnection: close\r\n\r\n')